home *** CD-ROM | disk | FTP | other *** search
/ Cream of the Crop 20 / Cream of the Crop 20 (Terry Blount) (1996).iso / program / n_b_v203.zip / TPRNTLEN.DMO < prev    next >
Text File  |  1996-07-04  |  2KB  |  41 lines

  1. $if 0
  2.     ┌──────────────────────────╖                        PowerBASIC v3.20
  3.  ┌──┤          DASoft          ╟──────────────────────┬──────────────────╖
  4.  │  ├──────────────────────────╢    Copyright 1995    │ DATE: 1995-10-01 ╟─╖
  5.  │  │ FILE NAME   TPRNTLEN.DMO ║          by          ╘════════════════─ ║ ║
  6.  │  │                          ║  Don Schullian, Jr.                     ║ ║
  7.  │  ╘══════════════════════════╝                                         ║ ║
  8.  │ A license is hereby granted to the holder to use this source code in  ║ ║
  9.  │ any program, commercial or otherwise,  without receiving the express  ║ ║
  10.  │ permission of the copyright holder and without paying any royalties,  ║ ║
  11.  │ as long as this code is not distributed in any compilable format.     ║ ║
  12.  │  IE: source code files, PowerBASIC Unit files, and printed listings   ║ ║
  13.  ╘═╤═════════════════════════════════════════════════════════════════════╝ ║
  14.    │                ....................................                   ║
  15.    ╘═══════════════════════════════════════════════════════════════════════╝
  16. $endif
  17.  
  18. $INCLUDE "DAS-NBT1.INC"
  19. COLOR 7, 0
  20. CLS
  21. ? "┌───────────────────────────────────────────────────────────────────────
  22. ? "│ fTprintLEN% ( V$, MidPos% )
  23. ? "├─────────────────────────────────────────────────────────────────────────
  24. ? "│ As Tprint and family accept embedded attribute commands their length may
  25. ? "│ not be their actual 'visual length'. This function returns that length.
  26. ? "├────────────────────────────────────────────────────────────────────────────
  27. ? "│ Test$ contains 2 triggers () but the first of the two is followed by yet
  28. ? "│ another trigger so only 1 trigger is printed and the attribute remains the
  29. ? "│ same. The third  and the following 'Å' change the attribute to 143
  30. ? "└─────────────────────────────────────────────────────────────────────────────
  31. ?
  32.  
  33. Test$ = "This isÅ a test."        ' this is what we're working with
  34. PRINT test$                          ' PowerBASIC prints this
  35.                                      '  produces 1 printed 
  36. Tprint 14, 1, Test$, 0               ' Tprint does this with the  triggers
  37.                                      '
  38. Tlen% = fTprintLEN%( Test$, 1 )      ' the visible length
  39.  
  40. M$ = USING$( "The visible length of Test$ is ## characters.", Tlen% )
  41. Tprint 16, 1, M$, 0